﻿using System;
using System.ComponentModel;
using System.Configuration;
using System.Drawing.Design;
using mki.Backup.Objects.Converters;
using mki.Backup.Objects.Editors;

namespace mki.Backup.Objects
{
	/// <summary>
	/// Zip Folder Block
	/// </summary>
	public class ZipJobElement : CustomConfigurationElement
	{
		#region Properties (4)

		// Public Properties (4) 

		/// <summary>
		/// Gets the add file collection.
		/// </summary>
		/// <value>The add file collection.</value>
		[ConfigurationProperty("addFiles", IsDefaultCollection = false)]
		[ConfigurationCollection(typeof(ZipAddFileSection), AddItemName = "addFile")]
		[Browsable(false)]
		public ZipAddFileSection AddFileCollection
		{
			get { return base["addFiles"] as ZipAddFileSection; }
		}

		/// <summary>
		/// Gets the add folder collection.
		/// </summary>
		/// <value>The add folder collection.</value>
		[ConfigurationProperty("addFolders", IsDefaultCollection = false)]
		[ConfigurationCollection(typeof(ZipAddFolderSection), AddItemName = "addFolder")]
		[Browsable(false)]
		public ZipAddFolderSection AddFolderCollection
		{
			get { return base["addFolders"] as ZipAddFolderSection; }
		}

		/// <summary>
		/// Gets or sets the name.
		/// </summary>
		/// <value>
		/// The name.
		/// </value>
		[ConfigurationProperty("name", IsRequired = true, IsKey = true)]
		public new String Name
		{
			get { return base["name"].ToString(); }
			set
			{
				base["name"] = value;
				base.OnPropertyChanged("Name");
			}
		}

		/// <summary>
		/// Gets or sets the name of the target folder and file.
		/// </summary>
		/// <value>The name of the target folder and file.</value>
		[ConfigurationProperty("targetFolderAndFileName", IsRequired = true)]
		[Editor(typeof(FolderAndFileBrowserUITypeEditor), typeof(UITypeEditor)), TypeConverter(typeof(ReadOnlyStringConverter))]
		[Description("Set the target folder and file name."), Category("Design")]
		public String TargetFolderAndFileName
		{
			get { return (String)this["targetFolderAndFileName"]; }
			set { this["targetFolderAndFileName"] = value; }
		}

		#endregion Properties
	}
}